﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;

/// <summary>
/// Summary description for BusinessException
/// </summary>
public class BusinessException : Exception {
	protected List<Message> messages;

	public List<Message> Messages {
		get {
			return this.messages;
		}
		set {
			this.messages = value;
		}
	}

	public BusinessException() : base() {
		this.messages = new List<Message>();
	}

	public void addMessage(Message.Type type, string text) {
		this.messages.Add(new Message(type, text));
	}

	public void addMessage(Message message) {
		this.messages.Add(message);
	}
}
